<template>
  <div id="app">
    <Topbar class="topbar" />
    <router-view class="approuter"></router-view>
    <CommonLoading v-show="isLoading"></CommonLoading>
  </div>
</template>

<script>
import utils from '@/lib/utils'
export default {
  name: 'app',
  components: {
    CommonLoading: require('@/components/common_loading'),
    Topbar:require('@/components/common_topbar')
  },
  computed: {
    isLoading(){
      return this.$store.state.globalData.isLoading
    },
  },
  created(){
    let self = this
    if(utils.os('weixin')){
      let payload = {
        callback: function(){
          self.$store.dispatch('wxShare', {
            title: 'Z Plus 约课系统',
            link: window.location.origin,
            imgUrl: 'http://opmju0pmq.bkt.clouddn.com/zp-test-banner-5.jpg',
            desc: 'Z Plus H5 约课系统首页'
          })
        }
      }
      this.$store.dispatch('wxRegister', payload)
    }
  },
  mounted(){
    document.body.addEventListener('touchstart', function () {})//触发ios端的:active伪类样式
  }
}
</script>

<style lang="scss">
@import "./css/iconfont.css";
@import "./css/config";
html{
  width: 100%;
  height: 100%;
}
body{
  width: 100%;
  height: 100%;
}
#app {
  width: 100%;
  height: 100%;
  .topbar{
  	position: fixed;
  	top:0;
  	z-index: 1000;

  }
  .approuter{
    margin-top: 60px;
    box-sizing: border-box;
    z-index: 100;
  }
}
::-webkit-scrollbar{
  display: none;
}
</style>
